Following is a listing of events fired by the DjVu Browser Plug-in along with their descriptions.
Name | Description |
---|---|
PageChange (ByVal long newpage) |
Fired after the page changes, after the newly current page is decoded. Methods and properties that depend on the decode status of the document should be called from this event. Example (JScript): <SCRIPT FOR=myDjVu EVENT="PageChange(newpage)" LANGUAGE="JScript"> alert("Page changed to " + newpage) </SCRIPT> |
ZoomChange (ByVal BSTR newzoom) |
Fired after the zoom changes. Example (JScript): <SCRIPT FOR=myDjVu EVENT="ZoomChange(newzoom)" LANGUAGE="JScript"> alert("Zoom Changed to " + newzoom); </SCRIPT> |
DisplayModeChange (ByVal BSTR newlayer) |
Fired whenever a new layer is selected for view. Example (JScript): <SCRIPT FOR=myDjVu EVENT="DisplayModeChange(newlayer)" LANGUAGE="JScript"> alert("Layer Changed to " + newlayer); </SCRIPT> |
BackForwardChange (ByVal BSTR backforward) |
Fired whenever the view changes.
Example (JScript): <SCRIPT FOR=myDjVu EVENT="BackForwardChange(backforward)" LANGUAGE="JScript"> alert("Backforward history is now " + backforward); </SCRIPT> |
ScrollEvent (ByVal BSTR hv) |
Fired whenever user pans or moves the scrollbar.
Example (JScript): <SCRIPT FOR=myDjVu EVENT="ScrollEvent(hv)" LANGUAGE="JScript"> alert("Scroll changed to " + hv); </SCRIPT> |
HyperlinkClick (Bool pDolink, BSTR pUrl, BSTR pTarget, BSTR pComment) |
Fired when a hyperlink is clicked to enable blocking, redirecting or granting link access. Note: Only applicable when a DjVu document contains hyperlinks: Example (Visual Basic): Private Sub DjVuCtl1_HyperlinkClick(pDolink As Boolean, pUrl As String, pTarget As String, pComment As String) If (pUrl = "http://www.lizardtech.com/") then pDolink = 1 pUrl = "http://www.extensis.com" pTarget = "new" pComment = "If original URL is http://www.lizardtech.com/, redirect to http://www.extensis.com in a new window" ElseIf (pUrl = "http://www.extensis.com") Then pDolink = 0 pComment = "If original URL is http://www.extensis.com, block link" Else pDolink = 1 pUrl = "http://www.msn.com" pComment = "If any other URL, redirect to http://www.celartem.com" End If End Sub |
PlugInError (BbVal BSTR message) |
Fired when an error occurs. Example: <SCRIPT FOR=myDjVu EVENT="PluginError(message)" LANGUAGE="JScript"> alert("Error: " + message); </SCRIPT> |
LayoutChange (ByVal BSTR newlayout) |
Fired when the layout is changed. Example (Jscript): <SCRIPT FOR=myDjVu EVENT="LayoutChange(newlayout)" LANGUAGE="JScript"> alert("Layout changed to " + newlayout); </SCRIPT> |
RequestPassword (ByVal BSTR ReqUrl, ByVal int nRegId, ByVal int nReTry) |
Fired when a user attempts to open a secure DjVu file. Example (JScript): <SCRIPT FOR=myDjVu EVENT="RequestPassword (ReqUrl,nRegId, nReTry)" LANGUAGE="JScript"> alert(ReqUrl.toString() + "is a secured DjVu file, please enter UserID and Password. This is request number "+ nReTry.toString() + "."); </SCRIPT> Note: |
DocumentExpired (ByVal BSTR Url, Bool bOpenIt) |
Fired when all three of the following criteria are met:
Example (Visual Basic): If an expired document was secured with the following parameters, viewing will fail except for documents whose expiry date is 03/05/2006. Private Sub DjVuCtl1_DocumentExpired(ByVal Url As String, bOpenIt As Boolean) If (DjVuCtl1.ExpiryDate = "03/05/2006") Then bOpenIt = True MsgBox "Access granted: File expired on " + DjVuCtl1.ExpiryDate Else bOpenIt = False MsgBox "Access denied: File expired on " + DjVuCtl1.ExpiryDate End If End Sub |